$(function () {
    var contraction = $("[data-role='contraction']");

    contraction.each(function () {
        if ($(this).hasClass("open")) {
            $(this).children("[data-role='list']").toggle(300);
        }
    });

    contraction.children("[data-role='title']").on("click", function () {
        $(this).parent().toggleClass("open");
        $(this).parent().children("[data-role='list']").toggle(300);
    });
});